<?php
$dbname = 'ncdb';
$dbhost = 'cougar.wou.edu';
$dbuser = 'ncdb';
$dbpass = 'bdcn';
$db = mysql_connect($dbhost,$dbuser,$dbpass);

$entry = mysql_real_escape_string($_REQUEST['autocomplete_parameter']);

$col      = $_GET['searchCol'];

$sql = "SELECT $col from ncdb_Resources WHERE $col LIKE '$entry%'";
//echo $sql;
$result = mysql_db_query($dbname,$sql);

echo '<ul>';
while ($value = mysql_fetch_assoc($result)) {
	$colText = $value[$col];
	echo '<li>'.$colText.'</li>';
}
echo '</ul>';

/*
$entries = array();
while($row = mysql_fetch_assoc($result))
	$entries[] = '"'.addslashes($row['title']).'"';
	echo '{fortext:"'.addslashes($entry).'",results:['.implode(',',$entries).']}';
*/
?>